package com.wq.feign.api.clients;


import com.wq.feign.api.domain.Result;
import com.wq.feign.api.domain.request.ProductReq;
import com.wq.feign.api.sentinel.ConsumerFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@Component
@FeignClient(name="feign-provider-8081"/*,fallback = ConsumerFallBack.class*/)
public interface ProductProviderClient {

    /**
     * 查询
     * @return
     */
    @GetMapping("product/provider/get/info")
    public Result getServiceInfo();

    /**
     * 查询
     * @param id
     * @return
     */
    @GetMapping("product/provider/get/{id}")
    public Result selectById(@PathVariable("id") Long id);


    @PostMapping("product/provider/update")
    public Result updateProduct(@RequestBody ProductReq productReq);
}

